<?php
/**
 * Created by PhpStorm.
 * User: samsung
 * Date: 2018/8/13
 * Time: 10:03
 */
//用户信息表的字段验证器
namespace app\validate;

use think\Validate;

class User extends Validate
{
    //Validate中的rule重写
    protected $rule = [
        'name|姓名' => [ //字段|别名 ,验证出错的时候前台显示别名字符
          'require', //必须填写
            'min'=>5, //最小字数
            'max'=>20, //最大字数
        ],

        'email' => [
          'require',
          'email'=>'email',
        ],

        'password' => [
            'require',
            'min'=>3,
            'max'=>12,
            'alphaNum',//仅允许字母加数字
        ],

        'telphone' => [
            'require',
            'mobile',
        ]
    ];
}